-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release PHPCSExtra 1.1.1 #269
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... which wasn't completely alphabetic anymore.
…order README: fix order of the sniff list
... in anticipation of additional test case files being added.
If no `php_version` is passed, the sniff will behave as before. However, is a `php_version` is passed, the sniff will now selectively stay silent depending on the configured PHP and whether the proposed fixes could be applied. Includes additional tests. Includes adding information about the support of the `php_version` config setting to the README docs.
…version Modernize/Dirname: respect a passed `php_version`
…e-statements CS: alphabetize use statements
These variables are only accessed within conditions and those conditions already sufficiently ensure that the variables will be set for the conditions path. Even so, PHPStan cannot handle this, so we may as well declare sensible defaults for each of those variables to make things more explicit.
This variable is only accessed within conditions and those conditions already sufficiently ensure that the variable will be set for the conditions path. Even so, PHPStan cannot handle this, so we may as well declare a sensible default for this variable to make things more explicit.
These variables are only accessed within conditions and those conditions already sufficiently ensure that the variables will be set for the conditions path. Even so, PHPStan cannot handle this, so we may as well declare sensible defaults for each of those variables to make things more explicit.
The condition was checking the wrong variable against `false`.
Universal/NoEchoSprintf: bug fix
…t-redundant-defaults Various sniffs: set redundant default values
... by casting to `int` for a property which expects `int`.
…abs-type-safety Universal/DisallowInlineTabs: increase type safety
... and make these docblocks a little more consistent.
... and make them more consistent across the sniffs.
Definitely not claiming completeness. This is just another iteration step in improving the documented types.
Docs: various improvements
PHPStan is a good addition to our QA toolkit and with improvements PHPStan has made over the years is now a viable tool for us to use (previously it would give way too many false positives). This commit: * Adds a separate job to the `basics` workflow in GH Actions. Notes: - I've **not** added PHPStan to the Composer dependencies for two reasons: 1. It doesn't allow for installation on PHP < 7.2, which would break/block the `composer install` for our test runs. 2. It would add dependencies which could conflict/cause problems for our test runs due to those defining token constants too. - [Phive](https://phar.io/) could potentially be used to still have a setup which can be used locally, but just running locally from a PHPStan PHAR file should work just fine. - For CI, PHPStan will be installed as a PHAR file by `setup-php` now. This does carry a risk _if_ PHPStan would make breaking changes or if a new release adds rules for the levels being scanned as, in that case, builds could unexpectedly start failing. Fixing the version for the `setup-php` action installs to the current release `1.10.32` could prevent that, but that adds an additional maintenance burden of having to keep updating the version as PHPStan releases pretty often. So, for now, I've elected to run the risk of random failures. If and when those start happening, this should be re-evaluated. - The PHP version for the CI run is set to PHP 7.4 to prevent PHPStan throwing some errors/notices related to the outdated PHPUnit version being used. * Adds a configuration file for PHPStan. Notes: - PHPStan needs to know about the dependencies (PHPCS et al), so I'm (re-)using the bootstrap file for the tests to load the PHPCS autoloader and register the standard with the PHPCS autoloader as adding an `autoload` directive to the `composer.json` file would cause problems with the PHPCS autoloader. - PHPStan flags type checks on properties with a documented type, while without `strict_types` we cannot always be sure the properties set will be of the correct type. For that reason, I've set `treatPhpDocTypesAsCertain` to `false` (which silences those notices). - I've gone through the scan results up to level 6 with a fine toothcomb and fixed what was reasonable to fix and ignored those things which should *not* be fixed. * Adds the configuration file to `.gitattributes` and the typical overload file for the configuration file to `.gitignore`. Refs: * https://phpstan.org/ * https://phpstan.org/config-reference
Add PHPStan to QA checks
Changelog for PHPCSExtra 1.1.1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Release checklist
General
composer.json
- N/A✏️ Remember to add a release link at the bottom!
README
(if applicable) - N/A only update needed, was already made in PR Modernize/Dirname: respect a passedphp_version
#261Release
develop
!) & copy & paste the changelog to it.✏️ Check if anything from the link collection at the bottom of the changelog needs to be copied in!
develop
to be equal tostable
Publicize